#ifndef GAME_H
#define GAME_H

#include "Singleton.h"

#include <QDebug>
#include <QList>

class WindowImp;
class WindowSystemFactory;

extern QString platform;

class WindowSystemFactory: public CSingleton<WindowSystemFactory> {
public:
    virtual WindowImp* MakeWindowImp();
};

class Window {
public:
    Window(){ _imp = 0; }
    virtual ~Window(){}

    virtual QString draw() = 0;
protected:
    WindowImp* GetWindowImp()
    {
        if(_imp == 0)
        {
            _imp = WindowSystemFactory::instance()->MakeWindowImp();
        }
        return _imp;
    }

private:
    WindowImp* _imp;
};

class ApplicationWindow: public Window {
public:
    ApplicationWindow(){}
    ~ApplicationWindow(){}
    virtual QString draw();
};

class IconWindow: public Window {
public:
    IconWindow(){}
    ~IconWindow(){}
    virtual QString draw();
};


class WindowImp {
public:
    virtual QString DeviceDraw() { return "WindowImp"; }
    virtual QString DeviceDrawIcon() { return "WindowImpIcon"; }
};

class XWindowImp: public WindowImp {
public:
    virtual QString DeviceDraw() {
        return "XWindowImp";
    }
    virtual QString DeviceDrawIcon() {
        return "XWindowImpIcon";
    }
};

class PMWindowImp: public WindowImp {
public:
    virtual QString DeviceDraw() {
        return "PMWindowImp";
    }
    virtual QString DeviceDrawIcon() {
        return "PMWindowImpIcon";
    }
};



#endif // GAME_H
